CREATE TABLE [dbo].[tb_Convocatorias]
(
[idConvocatoria] [int] NOT NULL IDENTITY(1, 1),
[Descripcion] [varchar] (300) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TipoConvocatoria] [int] NOT NULL,
[FechaInicioVacaciones] [datetime] NOT NULL,
[FechaCierre] [datetime] NOT NULL,
[FechaFinVacaciones] [datetime] NOT NULL,
[FechaLimite] [datetime] NULL,
[Estado] [int] NOT NULL,
[Junta] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Convocatorias] ADD CONSTRAINT [PK_tb_Convocatorias] PRIMARY KEY CLUSTERED  ([idConvocatoria]) WITH (FILLFACTOR=100) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Convocatorias] WITH NOCHECK ADD CONSTRAINT [FK_tb_Convocatorias_tb_EstadosDeConvocatorias] FOREIGN KEY ([Estado]) REFERENCES [dbo].[tb_EstadosDeConvocatorias] ([idEstadoConvocatoria])
GO
ALTER TABLE [dbo].[tb_Convocatorias] ADD CONSTRAINT [FK_tb_Convocatorias_tb_Juntas] FOREIGN KEY ([Junta]) REFERENCES [dbo].[tb_Juntas] ([id])
GO
ALTER TABLE [dbo].[tb_Convocatorias] WITH NOCHECK ADD CONSTRAINT [FK_tb_Convocatorias_tb_TiposDeConvocatorias] FOREIGN KEY ([TipoConvocatoria]) REFERENCES [dbo].[tb_TiposDeConvocatorias] ([idTipoConvocatoria])
GO
